home *** CD-ROM | disk | FTP | other *** search
- /*
- (C) 1995-96 AROS - The Amiga Replacement OS
- $Id: remtail.c,v 1.5 1996/08/13 13:56:07 digulla Exp $
- $Log: remtail.c,v $
- Revision 1.5 1996/08/13 13:56:07 digulla
- Replaced __AROS_LA by __AROS_LHA
- Replaced some __AROS_LH*I by __AROS_LH*
- Sorted and added includes
-
- Revision 1.4 1996/08/01 17:41:17 digulla
- Added standard header for all files
-
- Desc:
- Lang: english
- */
- /* I want the macros */
- #define AROS_ALMOST_COMPATIBLE
- #include "exec_intern.h"
-
- /*****************************************************************************
-
- NAME */
- #include <exec/lists.h>
- #include <clib/exec_protos.h>
-
- __AROS_LH1I(struct Node *, RemTail,
-
- /* SYNOPSIS */
- __AROS_LHA(struct List *, list, A0),
-
- /* LOCATION */
- struct SysBase *, SysBase, 44, Exec)
-
- /* FUNCTION
- Remove the last node from a list.
-
- INPUTS
- list - Remove the node from this list
-
- RESULT
- The node that has been removed.
-
- NOTES
-
- EXAMPLE
- struct List * list;
- struct Node * tail;
-
- // Remove node and return it
- tail = RemTail (list);
-
- BUGS
-
- SEE ALSO
-
- INTERNALS
-
- HISTORY
- 26-08-95 digulla created after EXEC-Routine
- 26-10-95 digulla adjusted to new calling scheme
-
- ******************************************************************************/
- {
- __AROS_FUNC_INIT
- struct Node * node;
-
- assert (list);
- /*
- Unfortunately, there is no (quick) check that the node
- is in a list.
- */
-
- /* Get the last node of the list */
- if ( (node = GetTail (list)) )
- {
- /* normal code to remove a node if there is one */
- node->ln_Pred->ln_Succ = node->ln_Succ;
- node->ln_Succ->ln_Pred = node->ln_Pred;
- }
-
- /* return it's address or NULL if there was no node */
- return node;
- __AROS_FUNC_EXIT
- } /* RemTail */
-
-